package com.easygoods.request;

import com.bestvike.stone.spring.exception.AssertUtils;
import com.bestvike.stone.spring.rest.IRequest;
import com.easygoods.service.ConfigService;
import lombok.Data;

/**
 * Created by 许崇雷 on 2019-04-02.
 */
@Data
public class ChangePayPwdByOldRequest implements IRequest {
    private String oldPayPwd;
    private String newPayPwd;

    @Override
    public void assertValid() {
        AssertUtils.hasText(this.oldPayPwd, "oldPayPwd");
        AssertUtils.hasText(this.newPayPwd, "newPayPwd");
        AssertUtils.isTrue(this.newPayPwd.length() == ConfigService.getPayPwdLength(), "支付密码必须为" + ConfigService.getPayPwdLength() + "位");
    }
}
